package com.gwt.client.login.client;

import java.io.*;
import java.net.*;

class Transmitter
{
        
  BufferedReader inFromUser;
  Socket clientSocket;
  
  protected Transmitter() throws UnknownHostException, IOException{
          
  BufferedReader inFromUser = new BufferedReader( new InputStreamReader(System.in));
  
  }
  
  public void open() throws UnknownHostException, IOException{
          clientSocket = new Socket("localhost", 4444);
  }

  public void send(String message) throws IOException{
          DataOutputStream outToServer = new DataOutputStream(clientSocket.getOutputStream());
          outToServer.writeBytes(message + '\n');
  }
  
  public void recieve(String message) throws IOException{
          BufferedReader inFromServer = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
          System.out.println("FROM SERVER: " + message);
  }

  public void CloseSocket() throws IOException{
          
          clientSocket.close();  
  
  }
}
